# Maintainer: Thore Bödecker <foxxx0@archlinux.org>
# Contributor: Justin Benge <justinbng36@gmail.com>

pkgname=python-remoto
_pkgbase="${pkgname//python-/}"
pkgver=1.2.1
pkgrel=3
pkgdesc="A very simplistic remote-command-executor using connections to hosts"
arch=('any')
url="https://github.com/alfredodeza/${_pkgbase}"
license=('MIT')
depends=('python' 'python-execnet')
makedepends=('git' 'python' 'python-execnet' 'python-setuptools')
checkdepends=('python-pytest' 'python-mock')
source=("https://files.pythonhosted.org/packages/source/${_pkgbase:0:1}/${_pkgbase}/${_pkgbase}-${pkgver}.tar.gz")
sha256sums=('3bad101711b28bb6d339b8e04f835b3645d81735c1f3d496bad8004cd667ade8')

prepare() {
  cd "${srcdir}/${_pkgbase}-${pkgver}"
  :
}

build() {
  cd "${srcdir}/${_pkgbase}-${pkgver}"
  python setup.py build
}

check() {
  cd "${srcdir}/${_pkgbase}-${pkgver}"
  py.test -v remoto/tests
}

package() {
  cd "${srcdir}/${_pkgbase}-${pkgver}"
  python setup.py install --root="${pkgdir}" --optimize=1
  install -D -m644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
